{% load attachment_tags %}
{% load i18n %}

{% get_attachments for object as attachment_list %}
{% if attachment_list %}

<h5>附件列表:</h5>

{%  for attachment in attachment_list %}


<p>下图上传于:{{ attachment.attached_timestamp }}</p>

{%if attachment.is_image %} 
<p class="icaption center">
<img src="{{ attachment.file_url}}"  alt="{{attachment.summary}}" onclick="if(this.width>=720) window.open('{{ attachment.file_url}}');" onload="if(this.width>'720'){this.width='720';this.alt+='\n点击查看大图';}if(this.height>'720')this.height='720';" >
<br/><strong>{{ attachment.title }}</strong>
</p>
{%else%}
<a href="{{ attachment.file_url }}">{{ attachment.title  }}</a>
{% endif%} 
	
{% endfor %}


{% endif %}


{% if user.is_staff %}
<div style="text-align:right"><form class="yform" action="{% new_attachment_url object %}" method="GET">
<input class="submit-btn" type="submit" value="添加附件" />
</form></div>
{% endif %}


